import request from '@/utils/request'

// 查询bom资料变更列表
export function listBg(query) {
  return request({
    url: '/project/bg/list',
    method: 'get',
    params: query
  })
}

// 查询bom资料变更详细
export function getBg(bgId) {
  return request({
    url: '/project/bg/' + bgId,
    method: 'get'
  })
}

// 新增bom资料变更
export function addBg(data) {
  return request({
    url: '/project/bg',
    method: 'post',
    data: data
  })
}

// 修改bom资料变更
export function updateBg(data) {
  return request({
    url: '/project/bg',
    method: 'put',
    data: data
  })
}

// 删除bom资料变更
export function delBg(bgId) {
  return request({
    url: '/project/bg/' + bgId,
    method: 'delete'
  })
}

// 导出bom资料变更
export function exportBg(query) {
  return request({
    url: '/project/bg/export',
    method: 'get',
    params: query
  })
}


//提交
export function submitBg(bgId) {
  return request({
    url: '/project/bg/submitBg/' + bgId,
    method: 'put'
  })
}

//作废
export function cancellationBg(bgId,desc) {
  return request({
    url: '/project/bg/cancellationBg/' + bgId+'/'+desc,
    method: 'put'
  })
}

//提交
export function submitBgd(data) {
  return request({
    url: '/project/bgd',
    method: 'post',
    data: data
  })
}

//查询变更单号
export function findBodDets(djbh) {
  return request({
    url: '/project/bgd/findBodDets/' + djbh,
    method: 'get'
  })
}

//删除子项

export function deleteBgd(id) {
  return request({
    url: '/project/bgd/' + id,
    method: 'delete'
  })

}

//撤回
export function cancelBg(bgId,desc) {
  return request({
    url: '/project/bg/cancelBg/' + bgId+'/'+desc,
    method: 'put'
  })
}

//审核
export function submitBgs(bgId) {
  return request({
    url: '/project/bg/submitBgs/' + bgId,
    method: 'put'
  })
}
